(global.webpackJsonp = global.webpackJsonp || []).push([ [ "components/kp-model/modal-phone" ], {
    "47b4": function(e, n, t) {
        t.r(n);
        var o = t("5935"), i = t("f7a4");
        for (var r in i) "default" !== r && function(e) {
            t.d(n, e, function() {
                return i[e];
            });
        }(r);
        t("9084");
        var c = t("f0c5"), a = Object(c.a)(i.default, o.b, o.c, !1, null, "731f5919", null, !1, o.a, void 0);
        n.default = a.exports;
    },
    5935: function(e, n, t) {
        t.d(n, "b", function() {
            return o;
        }), t.d(n, "c", function() {
            return i;
        }), t.d(n, "a", function() {});
        var o = function() {
            this.$createElement;
            this._self._c;
        }, i = [];
    },
    9084: function(e, n, t) {
        var o = t("f108");
        t.n(o).a;
    },
    ccac: function(e, n, t) {
        Object.defineProperty(n, "__esModule", {
            value: !0
        }), n.default = void 0;
        var o = t("26cb"), i = t("7a6d"), r = t("a71e"), c = (t("7960"), t("db8f")), a = (u(t("03b8")), 
        t("4771")), s = u(t("801c"));
        function u(e) {
            return e && e.__esModule ? e : {
                default: e
            };
        }
        function f(e, n) {
            var t = Object.keys(e);
            if (Object.getOwnPropertySymbols) {
                var o = Object.getOwnPropertySymbols(e);
                n && (o = o.filter(function(n) {
                    return Object.getOwnPropertyDescriptor(e, n).enumerable;
                })), t.push.apply(t, o);
            }
            return t;
        }
        function p(e, n, t) {
            return n in e ? Object.defineProperty(e, n, {
                value: t,
                enumerable: !0,
                configurable: !0,
                writable: !0
            }) : e[n] = t, e;
        }
        var d = {
            data: function() {
                return {
                    modalName: "phone-Modal",
                    isstate: 0,
                    btnText: "#14BE82",
                    textPhone: "",
                    textCode: "",
                    btnwz: "获取验证码",
                    time: 60,
                    timer: "",
                    isAuth: "",
                    userInfo: {
                        code: "",
                        phone: "",
                        nickName: "",
                        avatarUrl: "",
                        gender: "",
                        unionid: "",
                        wxh5_openid: "",
                        pid: "",
                        resAppid: ""
                    },
                    url: "",
                    params: {
                        data: [],
                        params: {
                            height: "",
                            img: "",
                            show: 1,
                            width: ""
                        }
                    }
                };
            },
            computed: function(e) {
                for (var n = 1; n < arguments.length; n++) {
                    var t = null != arguments[n] ? arguments[n] : {};
                    n % 2 ? f(Object(t), !0).forEach(function(n) {
                        p(e, n, t[n]);
                    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : f(Object(t)).forEach(function(n) {
                        Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
                    });
                }
                return e;
            }({}, (0, o.mapGetters)([ "configs", "user", "phone_show", "login_show", "mainColor", "tabbar" ])),
            created: function() {
                var e = this, n = {
                    isLoading: !1,
                    isBlockLoading: !0
                }, t = getCurrentPages();
                if ("diy/diy/index" == t[t.length - 1].route && 0 == this.tabbar.data.length) return !1;
                (0, a.getStorageSync)("appid").then(function(n) {
                    var t = JSON.parse(n.data);
                    e.resAppid = t, e.initData();
                }, function(t) {
                    (0, i.wxh5Appid)(n).then(function(n) {
                        e.resAppid = (0, r.isEmpty)(n) ? "" : n.appid, (0, a.setStorageSync)("appid", e.resAppid).then(function(n) {
                            e.initData();
                        }, function(e) {});
                    });
                });
            },
            mounted: function() {},
            onShow: function() {},
            methods: {
                closeModel: function() {
                    s.default.commit("config/setData", {
                        login_show: !1,
                        phone_show: !1
                    });
                },
                initData: function() {},
                getUserInfo: (0, c.throttle)(function(e) {
                    var n = this;
                    wx.getUserProfile({
                        desc: "用于获取用户信息",
                        success: function(e) {
                            n.userInfo.nickName = e.userInfo.nickName, n.userInfo.avatarUrl = e.userInfo.avatarUrl, 
                            n.userInfo.gender = e.userInfo.gender, 1 == n.configs.is_force_getphone || 1 == n.configs.is_phone_platform ? s.default.commit("config/setData", {
                                login_show: !1,
                                phone_show: !0
                            }) : n.reLogin(), n.$emit("succe");
                        }
                    });
                }, 1500),
                getPhoneNumber: function(e) {
                    var n = this;
                    wx.login({
                        success: function(t) {
                            var o = {
                                code: t.code,
                                encryptedData: e.detail.encryptedData,
                                iv: e.detail.iv,
                                isLoading: !1
                            };
                            (0, i.getPhone)(o).then(function(e) {
                                if ((0, r.isEmpty)(e)) return n.$toast("绑定手机号失败请重试!"), !1;
                                n.userInfo.phone = e, (0, r.isEmpty)(n.user.id) ? (0, r.isEmpty)(n.user.id) && n.reLogin() : n.bindPo();
                            });
                        }
                    });
                },
                bindPo: function() {
                    var e = this, n = {
                        phone: e.userInfo.phone
                    };
                    (0, i.bindPhone)(n).then(function(n) {
                        s.default.commit("config/setData", {
                            login_show: !1,
                            phone_show: !1
                        }), (0, a.setStorageSync)("userInfo", n).then(function(n) {
                            e.$emit("bphone", "");
                        }, function(e) {});
                    });
                },
                login: function(e) {
                    var n = this;
                    wx.login({
                        success: function(e) {
                            n.$emit("succe", ""), 1 == n.configs.is_force_getphone || 1 == n.configs.is_phone_platform ? s.default.commit("config/setData", {
                                login_show: !1,
                                phone_show: !0
                            }) : n.reLogin();
                        }
                    });
                },
                reLogin: function() {
                    var e = this;
                    wx.login({
                        success: function(n) {
                            e.userInfo.code = n.code, (0, i.regLogin)(e.userInfo).then(function(n) {
                                s.default.commit("config/SET_USER", n), (0, a.setStorageSync)("userInfo", n).then(function(n) {
                                    e.$emit("bphone", "");
                                }, function(e) {}), s.default.commit("config/setData", {
                                    login_show: !1,
                                    phone_show: !1
                                });
                            });
                        }
                    });
                },
                event: function(e, n) {
                    (0, {
                        login: this.getUserInfo,
                        cancel: this.closeModel
                    }[e])(n);
                }
            }
        };
        n.default = d;
    },
    f108: function(e, n, t) {},
    f7a4: function(e, n, t) {
        t.r(n);
        var o = t("ccac"), i = t.n(o);
        for (var r in o) "default" !== r && function(e) {
            t.d(n, e, function() {
                return o[e];
            });
        }(r);
        n.default = i.a;
    }
} ]), (global.webpackJsonp = global.webpackJsonp || []).push([ "components/kp-model/modal-phone-create-component", {
    "components/kp-model/modal-phone-create-component": function(e, n, t) {
        t("543d").createComponent(t("47b4"));
    }
}, [ [ "components/kp-model/modal-phone-create-component" ] ] ]);